package v1

import (
	"github.com/gogf/gf/v2/frame/g"
	"wh-1-backend/internal/model"
)

type RoleListReq struct {
	g.Meta `path:"/admin/setting/role" tags:"role" method:"get" summary:"角色列表"`
	Name   string `json:"name" in:"query" v:"max-length:20" dc:"角色"`
	Slug   string `json:"slug" in:"query" v:"max-length:20"`
	PageCommonReq
}
type RoleListRes struct {
	Total int               `json:"total"`
	List  []*model.RoleInfo `json:"list"`
}

type RoleCreateReq struct {
	g.Meta `path:"/admin/setting/role" tags:"role" method:"post" summary:"创建角色"`
	Name   string `json:"name" v:"required|length:1,20" dc:"角色"`
	Slug   string `json:"slug" v:"required|length:1,20"`
	Menus  []uint `json:"menus" v:"required"`
}
type RoleCreateRes struct{}

type RoleUpdateReq struct {
	g.Meta `path:"/admin/setting/role/{Id}" tags:"role" method:"put" summary:"创建角色"`
	Id     uint   `json:"id" in:"path" v:"required|min:1"`
	Name   string `json:"name" v:"required|length:1,20" dc:"角色"`
	Slug   string `json:"slug" v:"required|length:1,20"`
	Menus  []uint `json:"menus" v:"required"`
}
type RoleUpdateRes struct{}

type RoleDeleteReq struct {
	g.Meta `path:"/admin/setting/role/{Id}" tags:"role" method:"delete" summary:"创建角色"`
	Id     uint `json:"id" in:"path" v:"required|min:1"`
}
